import request from '@/utils/request'

//获取资源文件列表
export function getResourceList(data) {
	return request({
		method: 'get',
		url: 'tbNetDisk/queryPageList',
		params: data
	})
}

//新增资源文件
export function addedFile(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/addFile',
		data
	})
}

//创建文件夹
export function createFolder(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/createDir',
		data
	})
}

//新增外部链接
export function addedFileLink(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/addOut',
		data
	})
}

//资源详情
export function queryFileDetail(id) {
	return request({
		method: 'get',
		url: 'tbNetDisk/query/' + id,
	})
}

//获取资源引用地址
export function getResourcePath(id) {
	return request({
		method: 'get',
		url: 'tbNetDisk/queryPathById/' + id
	})
}

//下载资源文件 - 增加下载数
export function downloadResource(id) {
	return request({
		method: 'get',
		url: 'tbNetDisk/download/' + id
	})
}

//下载资源文件 - 不加下载数
export function downloadResNoLog(id) {
	return request({
		method: 'get',
		url: 'tbNetDisk/downloadNoLog/' + id
	})
}

//发布一条资源
export function publishResource(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/release',
		data
	})
}

//批量发布资源
export function batchPublishResource(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/releaseBatch',
		data
	})
}

//设置密级
export function updateSecretSetting(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/updateLevel',
		data
	})
}

//重命名资源
export function renameResource(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/update',
		data
	})
}

//重命名文件夹
export function renameFolder(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/updateDir',
		data
	})
}

//假删资源
export function banDeleteResource(id) {
	return request({
		method: 'get',
		url: 'tbNetDisk/ban/' + id
	})
}

//移动资源
export function moveResource(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/move',
		data
	})
}

//批量移动资源
export function batchMoveResource(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/moveBatch',
		data
	})
}

//批量复制资源
export function batchCopyResource(data) {
	return request({
		method: 'post',
		url: 'tbNetDisk/copyBatch',
		data
	})
}